import request from '@/utils/request'

// 查询参数列表
export function listCompanyList(query) {
  return request({
    url: '/companyApi/list',
    method: 'get',
    params: query
  })
}


//信息导出
export function exportInfos(query) {
  return request({
    url: '/companyApi/export',
    method: 'get',
    params: query
  })
}

export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/companyApi' +
      '/changeStatus',
    method: 'put',
    data: data
  })
}
//信息导出
export function insert(data) {
  return request({
    url: '/companyApi/insert',
    method: 'post',
    data: data
  })
}
export function getCompany(id) {
  return request({
    url: '/companyApi/getCompany/'+ id,
    method: 'get'
  })
}

export function delCompany(roleId) {
  return request({
    url: '/companyApi/' + roleId,
    method: 'delete'
  })
}

export function update(data) {
  if(data.status==2){
    data.recruitPercent=0.00;
  }
  console.log(data);
  return request({
    url: '/companyApi/update',
    method: 'put',
    data: data
  })
}

export function updateRecruitPercent(data){
  return request({
    url: '/companyApi/updateRecruitPercent',
    method: 'put',
    data: data
  })
}


export function getQrCodeImg(companyId,company) {
  const data ={
    companyId,company
  }
  return request({
    url: '/wxQrcodeApi/export',
    method: 'post',
    data:data
  })
}

